<?php

require_once 'Zend/Controller/Plugin/Abstract.php';

class Core_Controller_Plugin_SetPagePath extends Zend_Controller_Plugin_Abstract
{
    /**
     * this function routes all requests that come in to the default module to the index controller / index action
     *
     * @param zend_controller_request $request
     */
    public function preDispatch($request)
    {
        if ($request->module == 'public' && $request->controller != 'plugin') {
            $request->setControllerName('index');
            $request->setActionName('index');
        }

    }
}